home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / jade / lisp / latin-1.jl < prev    next >
Lisp/Scheme  |  1995-03-09  |  1KB  |  39 lines

  1. ;;;; latin-1.jl -- Make the default glyph-table show Latin 1 chars
  2. ;;;  Copyright (C) 1994 John Harper <jsh@ukc.ac.uk>
  3.  
  4. ;;; This file is part of Jade.
  5.  
  6. ;;; Jade is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 2, or (at your option)
  9. ;;; any later version.
  10.  
  11. ;;; Jade is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ;;; GNU General Public License for more details.
  15.  
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with Jade; see the file COPYING.  If not, write to
  18. ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. (provide 'latin-1)
  21.  
  22. (defvar use-latin-1 nil
  23.   "Non-nil when the Latin-1 character set is being used.")
  24.  
  25. ;;;###autoload
  26. (defun latin-1-mode ()
  27.   "Toggles whether or not the characters with numeric values from 160 to 256
  28. are displayed as octal escape sequences or in the Latin-1 character set."
  29.   (interactive)
  30.   (let
  31.       ((i 160))
  32.     (setq use-latin-1 (not use-latin-1))
  33.     (while (< i 256)
  34.       (set-glyph (default-glyph-table) i (if use-latin-1
  35.                          (make-string 1 i)
  36.                        (format nil "\\%o" i)))
  37.       (setq i (1+ i))))
  38.   use-latin-1)
  39.